﻿@model List<PotentialCustomer>
@{
    ViewBag.Title = "Danh sách khách hàng tiềm năng";
}

<div class="main-content-inner">
    <div class="breadcrumbs" id="breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="#">Home</a>
            </li>
            <li><a href="@Url.Action("Admin", "Account")">Dashboard</a></li>
            <li class="active">Danh sách khách hàng tiềm năng</li>
        </ul>
        <!-- /.breadcrumb -->

    </div>

    <div class="page-content">


        <div class="page-header">
            <h1>Danh sách khách hàng tiềm năng
								
            </h1>
        </div>
        <!-- /.page-header -->
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="row">
                    <div class="col-xs-12">
                        @using (Html.BeginForm(null, null, FormMethod.Post, new { @id = "manageForm" }))
                        {
                            @Html.AntiForgeryToken()
                            <input type="hidden" name="id" id="Id" />
                            <input type="hidden" name="Active" id="Active" />
                            <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th>Tên khách hàng</th>
                                        <th>Số điện thoại</th>
                                        <th>Email</th>

                                    </tr>
                                </thead>

                                <tbody>
                                    @if (Model != null && Model.Count > 0)
                                    {
                                        foreach (PotentialCustomer item in Model)
                                        {
                                        <tr>

                                            <td>
                                                @item.CusName
                                            </td>
                                            <td>
                                                @item.CusPhone
                                            </td>
                                            <td>@item.CusEmail</td>
                                        </tr>
                                        }
                                    }

                                </tbody>
                            </table>
                        }
                    </div>
                </div>
                
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /.page-content -->
</div>
<script type="text/javascript">
    jQuery(function ($) {
        //initiate dataTables plugin
        var oTable1 =
        $('#dynamic-table')
        //.wrap("<div class='dataTables_borderWrap' />")   //if you are applying horizontal scrolling (sScrollX)
        .dataTable({
            bAutoWidth: false,
            "aoColumns": [
					  null, null,
					  { "bSortable": false }
            ],
            "aaSorting": [],

            //,
            //"sScrollY": "200px",
            //"bPaginate": false,

            //"sScrollX": "100%",
            //"sScrollXInner": "120%",
            //"bScrollCollapse": true,
            //Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered"
            //you may want to wrap the table inside a "div.dataTables_borderWrap" element

            //"iDisplayLength": 50
        });
        //oTable1.fnAdjustColumnSizing();



        /********************************/
       

    })
    function Delete(id, title) {
        bootbox.confirm("Are you sure to delete " + title + " ?", function (result) {
            if (result) {
                $("#Id").val(id);
                $('#manageForm').attr('action', '@(Url.Action("Delete"))').submit();
            }
        });
    }
</script>

<script type="text/javascript">
    setAdminCurrentUrl('@Url.Action("Index", "PotentialCustomer")');
</script>
